﻿/*******************************************************************
Copyright (c) 2011 이재범

*  Permission is hereby granted, free of charge, to any person
*  obtaining a copy of this software and associated documentation
*  files (the "Software"), to deal in the Software without
*  restriction, including without limitation the rights to use,
*  copy, modify, merge, publish, distribute, sublicense, and/or sell
*  copies of the Software, and to permit persons to whom the
*  Software is furnished to do so, subject to the following
*  conditions:
* 
*  The above copyright notice and this permission notice shall be
*  included in all copies or substantial portions of the Software.
* 
*  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
*  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
*  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
*  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
*  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
*  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
*  OTHER DEALINGS IN THE SOFTWARE.
*******************************************************************/

#include "hash.h"
#include "crawler.h"
#include "search.h"
#include "server.h"
#include <iostream>
#include <boost/lexical_cast.hpp>
#include <sstream>
int main()
{
	/*
	CrawlerArxiv * c = new CrawlerArxiv();
	c->restart();
	*/
	/*
	Crawler::url_finished_list.push_back(L"http://www.artofproblemsolving.com/Forum/viewforum.php?f=52");
	Crawler *c = new Crawler(L"http://www.artofproblemsolving.com/Forum/viewforum.php?f=52");
	c->operator()();
	*/
	
	Crawler *c = new Crawler();
	c->restart();
	/*
	Search::load_database();
	while(1)
	{
		Server* server = new Server(); 
		delete server;
	}
	*/

	/*
	while (true)
	{
	string query;
	cout << "검색어 : " ;
	getline(cin, query);
	Search s(query);
	}

	*/
	/*
	string str = "a";
	int numb = -1;

	cout << numb << endl;
	*/
	
	Hash h("\\left| (m^2 + 2000m+ 999999)- (3n^3 + 9n^2 + 27n) \\right|= 1.");
	cout << h.equation << endl;
	h.generate_hash_data();
	cout << h.get_hash();
	
	//InternetData(L"http://www.naver.com", L"D:\\k.txt");
	return 0;
}